// 企业库
import exp from 'constants'
import axios, {ResponseData} from 'yuxin-base/src/utils/axios'

// 获取企业列表
export const enterpriseLibrary = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise/get_enter_prise_library_list',
		data,
		method: 'POST'
	})
}

//企业详情
export const enterpriseDetails = (id: string): Promise<ResponseData> => {
	return axios.request({
		url: `/customer/enter_prise/get_enter_prise/${id}`,
		method: 'GET'
	})
}

//导出企业库数据
export const exportEnterprise = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise/export/enter_prise_library',
		data: data,
		method: 'post',
		responseType: 'blob'
	})
}

//终止合作
export const terminationCooperation = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise/stop_prise_team_work',
		data,
		method: 'POST'
	})
}

//企业库的统计
export const enterpriseLibraryCount = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise/get_enter_prise_library_count',
		data,
		method: 'POST'
	})
}

//查询改企业合作周期列表
export const cooperationCycleList = (id: string): Promise<ResponseData> => {
	return axios.request({
		url: `/customer/enter_prise/get_prise_team_work_list/${id}`,
		method: 'GET'
	})
}

// 企业入库
export const enterpriseWarehousingFun = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise/storage_enter_prise',
		data,
		method: 'POST'
	})
}

//编辑企业入库
export const updateEnterpriseWarehousing = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise/update_enter_prise_library',
		data,
		method: 'POST'
	})
}

//获取企业库的相关信息
export const enterpriseList = () => {
	return axios.request({
		url: '/customer/enter_prise/get_enter_prise_library_all',
		method: 'POST'
	})
}

//激活企业信息状态
export const enterpriseActivation = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise/update_enter_prise_status',
		data,
		method: 'POST'
	})
}
